import 'package:PLDroidMediaStreaming/model/StreamingProfile/VideoEncodingSize.dart';


import 'AVProfile.dart';
import 'EnumDefine.dart';
import 'SPStream.dart';
import 'SendingBufferProfile.dart';
import 'StreamStatusConfig.dart';

class StreamingProfile {
  static const int AUDIO_TRACK_INDEX = 0;
  static const int VIDEO_TRACK_INDEX = 1;
  /// Deprecated. replaced by VIDEO_QUALITY_LOW1
  @deprecated
  static const int QUALITY_LOW1 = 0;
  @deprecated
  static const int QUALITY_LOW2 = 1;
  @deprecated
  static const int QUALITY_LOW3 = 2;
  @deprecated
  static const int QUALITY_MEDIUM1 = 10;
  @deprecated
  static const int QUALITY_MEDIUM2 = 11;
  @deprecated
  static const int QUALITY_MEDIUM3 = 12;
  @deprecated
  static const int QUALITY_HIGH1 = 20;
  @deprecated
  static const int QUALITY_HIGH2 = 21;
  @deprecated
  static const int QUALITY_HIGH3 = 22;

  static const int VIDEO_QUALITY_LOW1 = 0;
  static const int VIDEO_QUALITY_LOW2 = 1;
  static const int VIDEO_QUALITY_LOW3 = 2;
  static const int VIDEO_QUALITY_MEDIUM1 = 10;
  static const int VIDEO_QUALITY_MEDIUM2 = 11;
  static const int VIDEO_QUALITY_MEDIUM3 = 12;
  static const int VIDEO_QUALITY_HIGH1 = 20;
  static const int VIDEO_QUALITY_HIGH2 = 21;
  static const int VIDEO_QUALITY_HIGH3 = 22;

  static const int AUDIO_QUALITY_LOW1 = 0;
  static const int AUDIO_QUALITY_LOW2 = 1;
  static const int AUDIO_QUALITY_MEDIUM1 = 10;
  static const int AUDIO_QUALITY_MEDIUM2 = 11;
  static const int AUDIO_QUALITY_HIGH1 = 20;
  static const int AUDIO_QUALITY_HIGH2 = 21;
  static const int LOW_LEVEL = 0;
  static const int MEDIUM_LEVEL = 1;
  static const int HIGH_LEVEL = 2;
  static const int VIDEO_ENCODING_HEIGHT_240 = 0;
  static const int VIDEO_ENCODING_HEIGHT_480 = 1;
  static const int VIDEO_ENCODING_HEIGHT_544 = 2;
  static const int VIDEO_ENCODING_HEIGHT_720 = 3;
  static const int VIDEO_ENCODING_HEIGHT_1088 = 4;
  @deprecated
  static const int VIDEO_ENCODING_SIZE_QVGA = 0;
  @deprecated
  static const int VIDEO_ENCODING_SIZE_VGA = 1;
  @deprecated
  static const int VIDEO_ENCODING_SIZE_HD = 3;
  @deprecated
  static const int VIDEO_ENCODING_SIZE_FHD = 4;

  /// Sets the audio quality.
  final int aQuality;
  final int vQuality;

  final AVProfile avProfile;

  final EncoderRCModes encoderRCMode;
  
  final ENCODING_ORIENTATION orientation;

  final VideoEncodingSize videoEncodingSize;

  final String publishUrl;

  final StreamStatusConfig ssConfig;

  final SPStream stream;

  final int sendTimeout;

  final SendingBufferProfile bufferInfo;

  StreamingProfile({
    this.aQuality, 
    this.vQuality, 
    this.avProfile, 
    this.encoderRCMode, 
    this.orientation, 
    this.videoEncodingSize, 
    this.publishUrl, 
    this.ssConfig, 
    this.stream, 
    this.sendTimeout, 
    this.bufferInfo
  });

  Map<String, dynamic> toJson() {
    return {
      "aQuality": aQuality,
      "vQuality": vQuality,
      "avProfile": avProfile?.toJSon(),
      "encoderRCMode": encoderRCMode?.index,
      "orientation": orientation?.index,
      "videoEncodingSize": videoEncodingSize?.toJson(),
      "publishUrl": publishUrl,
      "ssConfig": ssConfig?.toJson(),
      "stream": stream?.toJson(),
      "sendTimeout": sendTimeout,
      "bufferInfo": bufferInfo?.toJson(),
    };
  }
}